package cn.stylefeng.guns.modular.system.service;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.stylefeng.guns.core.common.page.LayuiPageFactory;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;
import java.util.Map;
import cn.stylefeng.guns.modular.system.entity.PageManage;
import cn.stylefeng.guns.modular.system.mapper.PageManageMapper;
/**
 * 首页管理Service
 *
 * @author yaying.liu
 * @since 2023-01-06 23:23:05
 */
@Service
public  class PageManageService extends ServiceImpl<PageManageMapper,PageManage>{

    /**
    * 查询首页管理
    */
    public Page<Map<String,Object>> selectByCondition(String condition, String beginTime, String endTime) {
        Page page = LayuiPageFactory.defaultPage();
        return this.baseMapper.selectByCondition(page,condition,beginTime,endTime);
    }

    /**
     * 根据条件查询数据
     */
    public List<PageManage> selectByList(Integer type) {
        return this.baseMapper.selectByList(type);
    }
    /**
    * 删除首页管理
    */
    public void deletePageManage(Long pageManageId) {
        this.baseMapper.deleteById(pageManageId);
    }

    /**
    * 添加首页管理
    */
    public void addPageManage(PageManage pageManage) {
        this.baseMapper.insert(pageManage);
    }
}